package com.foreknow.demo5;

public class Animal {
    String name;
    String sex;
    String color;
    int aniid;
    boolean married;

    public void eat() {
        System.out.println("吃饭");
    }
    public void sleep() {
        System.out.println("睡觉");
    }
    public void run() {
        System.out.println("奔跑");
    }
    public void play() {
        System.out.println("玩耍");
    }

    public static void main(String[] args) {
        Animal monkey = new Animal();
        monkey.name = "大壮";
        monkey.sex = "雄";
        monkey.color = "black";
        monkey.aniid = 5567;
        monkey.married = true;
        monkey.eat();
        monkey.sleep();
        monkey.run();
        monkey.play();
        System.out.println(monkey.name+"----"+monkey.sex+"----"+monkey.color+"----"+monkey.aniid+"----"+monkey.married);

        Animal giraffe = new Animal();
        giraffe.name = "小美";
        giraffe.sex = "雌";
        giraffe.color = "brown";
        giraffe.aniid = 777333;
        giraffe.married = false;
        giraffe.eat();
        giraffe.sleep();
        giraffe.run();
        giraffe.play();
        System.out.println(giraffe.name+"----"+giraffe.sex+"----"+giraffe.color+"----"+giraffe.aniid+"----"+giraffe.married);

    }

}
